package Q1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt(); //对立攻击
        int h = scanner.nextInt(); //对立血量
        int b = scanner.nextInt(); //光攻击
        int k = scanner.nextInt(); //光血量

        long ret = 0;
        while (h > 0 && k > 0) {
            //对立攻击，小红收到攻击
            ret += a;
            //光攻击，小红受到攻击
            ret += b;
            //对立与光相互攻击
            h -= b;
            k -= a;
        }

        if (h <= 0 && k <= 0) {
            System.out.println(ret);
        } else if (h <= 0) {
            ret += 10L * b;
            System.out.println(ret);
        } else {
            // k <= 0
            ret += 10L * a;
            System.out.println(ret);
        }
    }
}
